
/**
 * @name MASS L3b Heatwave testing stub
 *
 * @version 0.1.301t
 * @date 9/05/2013
 * @author Niko Simonson
 * @author Brett Yasutake
 *
 */
// IMPORTS
import MASS.*;                  // MASS Library
//import java.io.IOException;     // IO Exceptions
//import java.util.*;             // Vectors, etc.
//import ucar.ma2.ArrayFloat;     // for netCDF reader
//import ucar.ma2.IndexIterator;  // for netCDF reader
//import ucar.nc2.NetcdfFile;     // for netCDF reader
//import ucar.nc2.Variable;       // for netCDF reader

public class MassL3bHeatwave extends Place {

    // CONSTANTS - MASS arguments
    private static final String[] MASSARGS = {"dslab", "dslab-302",
        "machinefile.txt", "12345"};    // connection arguments
    private static final int NPROCESSES = 1;    // number of processes to employ
    private static final int NTHREADS = 2;      // number of threads to employ
    private static final int HANDLE = 0;        // unique Places handle number
    // CONSTANTS - functions
    private static final int init_ = 0;          // initialize Places
    private static final int computeTemp_ = 1;   // compute regional avg temps

    // CONSTANTS - heatwave constants
    private static final int DAYS = 30;          // days of data collection
    private static final int DAYSEGMENTS = 4;    // time slices per day
    // target variable T2: temperature at 2 meters above surface
    private static final String TARGET = "T2";
    // northwest regional climate data sample
    private static final String FILENAMEBEGIN = "/home/brett/netcdf_files/1980_jan/wrfout_d02_1980-01-";
    private static final String FILENAMEEND = ":00:00";  // end of file name
    private static final int XRANGE = 123;
    private static final int YRANGE = 162;
    // VARIABLES


    // PARALLELIZATION FUNCTIONS
    /**
     * *************CONSTRUCTOR
     *
     ***********************************
     * @name MassL1Heatwave
     * @param interval unused Empty constructor required for MASS Place
     * implementation
     * ***********************************************************
     */
    public MassL3bHeatwave(Object interval) {

    }

    /**
     * @name callMethod Provides enumerated list of functions to be parallelized
     * in MASS
     *
     * @param funcId - function ID (listed as Constants)
     * @param args - function parameters
     * @return - unused
     */
    public Object callMethod(int funcId, Object args) {
        switch (funcId) {
            case init_:
                return init(args);
            case computeTemp_:
                return computeTemp(args);
        }
        return null;
    }

    /**
     * @name init Initialization information for MASS Places index[0]: days
     * index[1]: time slices in a day
     *
     * @param args MASS initialization arguments, # of processes, # of threads
     * @return unused
     */
    public Object init(Object args) {

        return null;
    }

    /**
     * @name computeTemp Open netCDF file and compute average temperature over
     * the entire region
     *
     * @param args unused
     * @return true = success, false = exception occurred
     */
    public Object computeTemp(Object args) {
       return (Object)null;
    }

} // end MASS Heatwave
